/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.click.app.model;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author orgale
 */
@Entity
@Table(name = "measureUnits")
@NamedQueries({@NamedQuery(name = "MeasureUnit.findAll", query = "SELECT m FROM MeasureUnit m"), @NamedQuery(name = "MeasureUnit.findById", query = "SELECT m FROM MeasureUnit m WHERE m.id = :idMeasureUnit"), @NamedQuery(name = "MeasureUnit.findByName", query = "SELECT m FROM MeasureUnit m WHERE m.name = :name"), @NamedQuery(name = "MeasureUnit.findByDescription", query = "SELECT m FROM MeasureUnit m WHERE m.description = :description")})
public class MeasureUnit extends BaseObject implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE)
    @Basic(optional = false)
    @Column(name = "id_measure_unit")
    private Long id;
    @Column(name = "name")
    private String name;
    @Column(name = "description")
    private String description;

    public MeasureUnit() {
    }

    public MeasureUnit(Long id) {
        this.id = id;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof MeasureUnit)) {
            return false;
        }
        MeasureUnit other = (MeasureUnit) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.click.app.model.MeasureUnit[id=" + id + "]";
    }

    /**
     * @return the description
     */
    public String getDescription() {
        return description;
    }

    /**
     * @param description the description to set
     */
    public void setDescription(String description) {
        this.description = description;
    }

}
